#!/bin/sh

echo "Starting the copy-lualib.sh script..."

# 检查源目录
SOURCE_DIR="/usr/local/openresty/lualib"
echo "Checking source directory: $SOURCE_DIR"

if [ ! -d "$SOURCE_DIR" ]; then
    echo "Error: Source directory does not exist."
    exit 1
fi

# 检查目标目录
DEST_DIR="./plugins/openresty/lualib"
echo "Creating destination directory: $DEST_DIR"

mkdir -p "$DEST_DIR"

# 复制文件
echo "Copying files from $SOURCE_DIR to $DEST_DIR..."
cp -R "$SOURCE_DIR"/* "$DEST_DIR/"

echo "Copy operation completed."

exit 0